package com.dst.java_demo.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * <h1>通用相应对象定义</h1>
 *
 * @Author: LiJian
 * @Date: 2021/1/15 17:00
 */
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class CommonResponse<T> implements Serializable {
    public static final Integer OK_CODE = 0;
    public static final String OK_MESSAGE = "ok";
    private Integer code = OK_CODE;
    private String message = OK_MESSAGE;
    private T data;

    public CommonResponse(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public CommonResponse(T data) {
        this.data = data;
    }

}

